import { request } from '@/utils/request.js'

export default {
  getTournamentList(params) {
    return request({
      url: '/api/v1/admin/tournament/list',
      method: 'get',
      params
    })
  },
  createTournament(data = {}) {
    return request({
      url: '/api/v1/admin/tournament/create',
      method: 'post',
      data
    })
  },
  getTournamentSchedules(tournamentId) {
    return request({
      url: `/api/v1/admin/tournament/${tournamentId}/schedules`,
      method: 'get'
    })
  },
  createTournamentSchedules(data) {
    return request({
      url: '/api/v1/admin/tournament/schedule',
      method: 'post',
      data
    })
  },
  updateTournamentSchedules(data) {
    return request({
      url: '/api/v1/admin/tournament/schedule',
      method: 'put',
      data
    })
  },
  getTournamentStageUsers(data) {
    return request({
      url: '/api/v1/admin/tournament/stage-users',
      method: 'post',
      data
    })
  },
  // /

  createGroupsFromUsers(data) {
    return request({
      url: '/api/v1/admin/tournament/grouping/create-groups-from-users',
      method: 'post',
      data
    })
  },
  updateStartTime(data) {
    return request({
      url: '/api/v1/admin/tournament/grouping/update-start-time',
      method: 'post',
      data
    })
  },

  confirmGroups(data) {
    return request({
      url: '/api/v1/admin/tournament/grouping/confirm-groups',
      method: 'post',
      data
    })
  },
  openGuessStatus(data) {
    return request({
      url: '/api/v1/admin/guess/setStatus',
      method: 'post',
      data
    })
  },
  disqualification(data) {
    return request({
      url: '/api/v1/admin/tournament/disqualify',
      method: 'post',
      data
    })
  },
  exportGroups(data) {
    return request({
      url: '/api/v1/admin/tournament/groups/export',
      method: 'post',
      data
    })
  }
}
